package ExamSystemClient.model;

import java.io.Serializable;

/**
 * 选择题类
 *
 * @author Shuxian Huang
 */
public class ChoiceQuestion implements Serializable {
    private static final long serialVersionUID = -1225113970581096678L;

    /**
     * 考题编号
     */
    private int number;

    /**
     * 题干
     */
    private String stem;

    /**
     * 选项A
     */
    private Option optionA;

    /**
     * 选项B
     */
    private Option optionB;

    /**
     * 选项C
     */
    private Option optionC;

    /**
     * 选项D
     */
    private Option optionD;

    /**
     * 正确的选项
     */
    private Option.OptionCode rightOption;

    public ChoiceQuestion() {
    }

    public ChoiceQuestion(int number, String stem, Option optionA, Option optionB,
                          Option optionC, Option optionD, Option.OptionCode rightOption) {
        this.number = number;
        this.stem = stem;
        this.optionA = optionA;
        this.optionB = optionB;
        this.optionC = optionC;
        this.optionD = optionD;
        this.rightOption = rightOption;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public String getStem() {
        return stem;
    }

    public void setStem(String stem) {
        this.stem = stem;
    }

    public Option getOptionA() {
        return optionA;
    }

    public void setOptionA(Option optionA) {
        this.optionA = optionA;
    }

    public Option getOptionB() {
        return optionB;
    }

    public void setOptionB(Option optionB) {
        this.optionB = optionB;
    }

    public Option getOptionC() {
        return optionC;
    }

    public void setOptionC(Option optionC) {
        this.optionC = optionC;
    }

    public Option getOptionD() {
        return optionD;
    }

    public void setOptionD(Option optionD) {
        this.optionD = optionD;
    }

    public Option.OptionCode getRightOption() {
        return rightOption;
    }

    public void setRightOption(Option.OptionCode rightOption) {
        this.rightOption = rightOption;
    }

    @Override
    public String toString() {
        return "Q" +  number+"{" + "\n" +
                stem + "\n" +
                optionA + "\n" +
                optionB + "\n" +
                optionC + "\n" +
                optionD + "\n" +
                "rightOption: " + rightOption.str +
                '}';
    }

    /**
     * 打印考题
     * @return
     */
    public String printQuestion(){
        return stem + "\n" +
                optionA + "\n" +
                optionB + "\n" +
                optionC + "\n" +
                optionD ;
    }
}
